var g = (name, template, jsPath, filename, chunks) => { chunks = chunks || []; chunks = chunks.concat(["manifest", name]); return { name, template, jsPath, filename, chunks } };
const pageConfigs = [];
const devPageConfigs = [];

const chunks1 = ["vendors"];

//*配置
//html页配置
const htmlPageConfigs = {
    "index": {
        chunks: chunks1,
        // htmls: ['index']
        htmls: ['index']
    }
};

//通用js配置,priority:优先级，值大优先打包，第三方需优先项目中通用js打包
const commonJsConfigs = [
    { name: "vendors", test: /[\\/]node_modules[\\/]/ }
];

//别名
const alias = {
}

//复制路径列表
const copyPathList = [
];

const copyConfigs = [];

for (var p in htmlPageConfigs) {
    const template = `./src/${p}.ejs`;
    const jsPath = `./src/${p}.js`;
    const filename = `${p}.html`;
    var chunks = htmlPageConfigs[p].chunks || [];
    chunks = chunks.concat([p, "manifest"]);

    htmlPageConfigs[p].htmls.forEach(html => {
        devPageConfigs.push({ name: html, template, jsPath, filename: `${html}.html`, chunks })
    });
    pageConfigs.push({ name: p, template, jsPath, filename, chunks });
}

copyPathList.forEach(c => copyConfigs.push({ from: `./src/${c}`, to: c }));

module.exports = { pageConfigs, alias, commonJsConfigs, devPageConfigs, copyConfigs };